package com.cxd.web.frontend;

import com.cxd.entity.EbUser;
import com.cxd.service.IEbUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/f-register")
public class EbRegisterController {
    @Autowired
    private IEbUserService iEbUserService;
    @RequestMapping("/to_register")
    public String toRegister(){
        return "register";
    }
    @RequestMapping("/register")
    public String register(EbUser ebUser, Model model){
        ebUser.setEuStatus(1);
        System.out.println(ebUser);
        int result=iEbUserService.save(ebUser);
        model.addAttribute("result",result);
        return "reg-result";
    }
}
